const sqlModule = require('../../common/database/sql');
const models = sqlModule.models;
const classTypeModel = models.classType;

function listAll() {
  return new Promise(async (resolve, reject) => {
    try {
      const query = {
        orderBy: [{
          sort: "desc", // 按创建时间倒序
        }],
        limit:100
      };
      const todos = await classTypeModel.list(query);
      resolve(todos.data);
    } catch (error) {
      reject(error);
    };
  })
}

module.exports = {
  listAll
}